package book_management.user;

import book_management.operation.IOperation;
import book_management.operation.impl.*;

import java.util.Scanner;

public class AdminUser extends User{
    //因为现在的User父类没有无参，所以必须显示调用一下有参构造
    public AdminUser(String name) {
        super(name);
        this.operations = new IOperation[]{
                new ListAllBooksOperation(),
                new AddOperation(),//增加书籍
                new RemoveOperation(),//下架书籍
                new UpdateOperation(),//修改书籍
                new FindOperation()//查找书籍
        };
    }

    @Override
    public int menu() {
        System.out.println("====================================");
        System.out.println("欢迎" + this.name + "登录行知图书管理系统");
        System.out.println("1.显示当前的书籍列表");
        System.out.println("2.增加书籍");
        System.out.println("3.下架书籍");
        System.out.println("4.修改书籍");
        System.out.println("5.查找书籍");
        System.out.println("-1.退出系统");
        System.out.println("====================================");
        System.out.println("请输入你的选择");
        Scanner scanner = new Scanner(System.in);
        int chice = scanner.nextInt();
        return chice;//根据输入的数子,做出相应的处理。
    }
}
